Script can't find folder

I have been updating some scripts that were written for us to run in a different directory. The scripts that work run in an environment called OKDHS which is a project. The ones that don't work are exactly the same except we changed the START_DIR from "/OKDHS" to "/Training Area" (which is just a folder that is at the same level as the project OKDHS) and added a MID_DIR of "/OKDHS Training" (which is a project and is one level below the OKDHS project folder inside the Training Area folder). I have also updated the libraries folder from "libraries" to "libraries1" which is what the equivalent folder is named in the training area. I have double and triple checked my spelling and path and had a couple of more experienced developers (not .dxl but cobal some other languages) check and they can't figure out what is wrong. I am pasting in both the one that works and the one that doesn't in hopes that someone here can figure it out.

The one that works
//SETTINGS
string TITLE = "Associate Use Case"
string START_DIR = "/OKDHS"

string USECASE_MOD_NAME = "Use Case"
string USECASE_DEST_DIR = START_DIR "/Use Cases"
string USECASE_MOD_TEMPLATE = USECASE_DEST_DIR "/" USECASE_MOD_NAME

string USECASE_LIBRARY_FNAME = START_DIR "/Libraries/Use Case Library"
string PRODUCT_LIBRARY_FNAME = START_DIR "/Libraries/Product Library"
string STKHLDR_LIBRARY_FNAME = START_DIR "/Libraries/Stakeholder Library"

The one that doesn't work
//SETTINGS
string TITLE = "Use Case"
string START_DIR = "/Training Area"
string MID_DIR = "/OKDHS Training"

string USECASE_MOD_NAME = "Use Case"
string USECASE_DEST_DIR = START_DIR MID_DIR "/Use Cases"
string USECASE_MOD_TEMPLATE = USECASE_DEST_DIR "/" USECASE_MOD_NAME
string USECASE_LIBRARY_FNAME = START_DIR MID_DIR "/Libraries1/Use Case Library"
string PRODUCT_LIBRARY_FNAME = START_DIR MID_DIR "/Libraries1/Product Library"
string STKHLDR_LIBRARY_FNAME = START_DIR MID_DIR "/Libraries1/Stakeholder Library"

The error we get every time is that it cannot find any of the libraries. Thanks for the help.
ChristiFore - Wed Apr 06 12:03:36 EDT 2011

Re: Script can't find folder
llandale - Wed Apr 06 13:53:39 EDT 2011

I see that variable USECASE_LIBRARY_FNAME has this value:
/Training Area/OKDHS Training/Libraries1/Use Case Library

Now I'll bet there is no such module (or is that a folder) because you misspelled something.

Now if "/OKDHS Training" is a project itself, then you do NOT need the "/Trainign Area" reference.

If you can navigate to your "Use Case Library" and its a folder, run this dxl:
print ""
If its a module then open it and run this dxl:
print ""

I'm confident this will locate your spelling mistake.

  • Louie

Re: Script can't find folder
ChristiFore - Wed Apr 06 14:40:51 EDT 2011

llandale - Wed Apr 06 13:53:39 EDT 2011
I see that variable USECASE_LIBRARY_FNAME has this value:
/Training Area/OKDHS Training/Libraries1/Use Case Library

Now I'll bet there is no such module (or is that a folder) because you misspelled something.

Now if "/OKDHS Training" is a project itself, then you do NOT need the "/Trainign Area" reference.

If you can navigate to your "Use Case Library" and its a folder, run this dxl:
print ""
If its a module then open it and run this dxl:
print ""

I'm confident this will locate your spelling mistake.

  • Louie

Ok, so I am really new at this. I opened the library module and opened the DXL Interaction screen. I typed 'print ""'and hit run and nothing happened. What did I do wrong?

Re: Script can't find folder
Mathias Mamsch - Wed Apr 06 17:31:41 EDT 2011

Hmm ... If you were exact with your description there might be the explanation why this does not work. 'OKDHS' is a project and '/Training Area' is a folder, that is parallel / on the same level / a sibling of OKDHS? If you do startdir = "/Training Area" this will look either
a) for a folder named 'Training Area' under the database root
b) for a project named 'Training Area' anywhere in the database.

So you will need to enter the correct path to the training area as a start dir. For this, navigate in the database explorer to the training area folder and copy the path from the address field into you startdir field. This should be something like '/someproject/maybe some folder/Training Area'. Or convert the 'Training Area' folder to a project.

Depending on the scripts you are trying to run, it might be that the script depends on the startdir to be a project. This would however be very unusual.

Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: Script can't find folder
llandale - Thu Apr 07 11:07:22 EDT 2011

llandale - Wed Apr 06 13:53:39 EDT 2011
I see that variable USECASE_LIBRARY_FNAME has this value:
/Training Area/OKDHS Training/Libraries1/Use Case Library

Now I'll bet there is no such module (or is that a folder) because you misspelled something.

Now if "/OKDHS Training" is a project itself, then you do NOT need the "/Trainign Area" reference.

If you can navigate to your "Use Case Library" and its a folder, run this dxl:
print ""
If its a module then open it and run this dxl:
print ""

I'm confident this will locate your spelling mistake.

  • Louie

I really should 'preview'. What I typed didn't make it to the post. Run the following from various Folders and Modules:

Project prj = current
Folder  fld = current
Module  mod = current
 
if (!null prj) //
then print "Curr Proj: [" (fullName(prj)) "]\t<">\n"
else print "Curr Proj: null\n"
 
if (!null fld) //
then print "Curr Fold: [" (fullName(fld)) "]\t<">\n"
else print "Curr Fold: null\n"
 
if (!null mod) //
then print "Curr Mod:  [" (fullName(mod)) "]\t<">\n"
else print "Curr Mod:  null\n"


The 'rootName_' will come into play if your projects are not directly under the database but are rather under some other project or top-level folder. The 'fullName' is the path up to the parent Project.

 

 

  • Louie

 

 

Re: Script can't find folder
ChristiFore - Fri Apr 08 10:54:59 EDT 2011

llandale - Thu Apr 07 11:07:22 EDT 2011

I really should 'preview'. What I typed didn't make it to the post. Run the following from various Folders and Modules:

Project prj = current
Folder  fld = current
Module  mod = current
 
if (!null prj) //
then print "Curr Proj: [" (fullName(prj)) "]\t<">\n"
else print "Curr Proj: null\n"
 
if (!null fld) //
then print "Curr Fold: [" (fullName(fld)) "]\t<">\n"
else print "Curr Fold: null\n"
 
if (!null mod) //
then print "Curr Mod:  [" (fullName(mod)) "]\t<">\n"
else print "Curr Mod:  null\n"


The 'rootName_' will come into play if your projects are not directly under the database but are rather under some other project or top-level folder. The 'fullName' is the path up to the parent Project.

 

 

  • Louie

 

 

OK, so I am really really new at this and have not had any training at all on .dxl. I copied what you put in your post and pasted it into the dxl tool in DOORS while in the Use Case Library and it came back with 3 dxl errors.

-E- DXL: <Line:6> syntax error
-E- DXL: <Line:14> syntax error
-E- DXL: <Line:15> badly formed token (")

They seem pretty simple like typo's and I would fix them if I could but I have no idea what the problems would be. I really do appreaciate all the help.

Re: Script can't find folder
llandale - Fri Apr 08 12:15:21 EDT 2011

ChristiFore - Fri Apr 08 10:54:59 EDT 2011
OK, so I am really really new at this and have not had any training at all on .dxl. I copied what you put in your post and pasted it into the dxl tool in DOORS while in the Use Case Library and it came back with 3 dxl errors.

-E- DXL: <Line:6> syntax error
-E- DXL: <Line:14> syntax error
-E- DXL: <Line:15> badly formed token (")

They seem pretty simple like typo's and I would fix them if I could but I have no idea what the problems would be. I really do appreaciate all the help.

It doesn't seem to matter how many times I commit myself to using the "Preview" pane. Gads. In this case there is an issue with the left-right carat characters.

This is what I meant:
 

Project prj = current
Folder  fld = current
Module  mod = current
 
if (!null prj) //
then print "Curr Proj: [" (fullName(prj)) "]\t^"rootName_(prj) "^\n"
else print "Curr Proj: null\n"
 
if (!null fld) //
then print "Curr Fold: [" (fullName(fld)) "]\t^"rootName_(fld) "^\n"
else print "Curr Fold: null\n"
 
if (!null mod) //
then print "Curr Mod:  [" (fullName(mod)) "]\t^"rootName_(mod) "^\n"
else print "Curr Mod:  null\n"

Re: Script can't find folder
ChristiFore - Fri Apr 08 13:35:13 EDT 2011

llandale - Fri Apr 08 12:15:21 EDT 2011

It doesn't seem to matter how many times I commit myself to using the "Preview" pane. Gads. In this case there is an issue with the left-right carat characters.

This is what I meant:
 

Project prj = current
Folder  fld = current
Module  mod = current
 
if (!null prj) //
then print "Curr Proj: [" (fullName(prj)) "]\t^"rootName_(prj) "^\n"
else print "Curr Proj: null\n"
 
if (!null fld) //
then print "Curr Fold: [" (fullName(fld)) "]\t^"rootName_(fld) "^\n"
else print "Curr Fold: null\n"
 
if (!null mod) //
then print "Curr Mod:  [" (fullName(mod)) "]\t^"rootName_(mod) "^\n"
else print "Curr Mod:  null\n"

Thank you so much. That worked and it looks like I will be able to get the scripts to run now. I really appreciate the help and I will definately be back if I run into any more snags.